package com.jsmtr.rms.controller;

import java.util.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.jsmtr.rms.utils.*;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.jsmtr.rms.entity.BaseUser;
import com.jsmtr.rms.entity.DUserEducation;
import com.jsmtr.rms.entity.DUserFamily;
import com.jsmtr.rms.entity.DUserResume;
import com.jsmtr.rms.entity.DUserRewardPunishment;
import com.jsmtr.rms.entity.DUserTraining;
import com.jsmtr.rms.entity.DUserWorkExperience;
import com.jsmtr.rms.entity.DoBSUser;
import com.jsmtr.rms.entity.DoMSUser;
import com.jsmtr.rms.entity.DoOperationUser;
import com.jsmtr.rms.entity.ProjectInfo;
import com.jsmtr.rms.entity.ProjectInfoFlow;
import com.jsmtr.rms.entity.ProjectInfoJobs;
import com.jsmtr.rms.service.IDoBSService;
import com.jsmtr.rms.service.IDoMSService;
import com.jsmtr.rms.service.IDoResumeService;
import com.jsmtr.rms.service.IDoSZService;
import com.jsmtr.rms.service.IProjectService;
import com.jsmtr.rms.service.IUtilService;
import org.springframework.web.bind.annotation.ResponseBody;


@Controller
@RequestMapping("/Do/Driver")
public class DoDriverController {

    @Resource
    private IUtilService utilService;
    @Resource
    private IProjectService projectService;
    @Resource
    private IDoSZService szService;
    @Resource
    private IDoBSService bsService;
    @Resource
    private IDoMSService msService;
    @Resource
    private IDoResumeService doResumeService;

    //[start] 招聘实施主界面
    @RequestMapping("/")
    public String Index(HttpServletRequest request, Model model) {
        try {
            model.addAttribute("path", request.getContextPath());
            List<ProjectInfo> projects = projectService.getProjectInfos(EnumTools.RecruitType.驾驶员招聘.ordinal());
            StringBuilder pros = new StringBuilder();
            pros.append("<option value=''>直接选择或搜索选择</option>");
            for (ProjectInfo project : projects) {
                if (project.getState() != EnumTools.ProjectState.编辑中.ordinal()) {
                    pros.append("<option value='" + project.getId() + "'>" + project.getPname() + "</option>");
                }
            }
            model.addAttribute("projects", pros.toString());
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "Do/Driver/index";
    }
    //[end]

    //[start] 获得招聘方案责任部门列表
    @RequestMapping("/getdept")
    public void getdept(HttpServletRequest request, HttpServletResponse response) {
        try {
            String pid = request.getParameter("pid").trim();
            List<ProjectInfoFlow> flows = null;

            BaseUser user = utilService.getSessionUser(request);
            StringBuilder pros = new StringBuilder();
            //当前用户是招聘主管部门
            if (utilService.getConfig("hrcode").equals(user.getUdept())) {
                flows = projectService.getAllFlowDept(pid, 0);
                for (ProjectInfoFlow flow : flows) {
                    pros.append("<option value='" + flow.getDeptcode() + "'>" + flow.getDeptname() + "</option>");
                }
            } else {
                flows = projectService.getThisFlowDept(pid, user.getUdept());
                pros.append("<option value='" + flows.get(0).getDeptcode() + "'>" + flows.get(0).getDeptname() + "</option>");
            }

            utilService.printTextResult(pros.toString(), response);
        } catch (Exception e) {
            e.printStackTrace();
            utilService.printTextResult("", response);
        }
    }
    //[end]

    //[start] 获得招聘实施流程信息
    @RequestMapping("/getflows")
    public void getFlows(HttpServletRequest request, HttpServletResponse response) {
        try {
            String pid = request.getParameter("pid").trim();
            String deptcode = request.getParameter("deptcode").trim();
            List<ProjectInfoFlow> flows = projectService.getThisFlowDept(pid, deptcode);
            StringBuilder result = new StringBuilder();
            int index = 1;
            for (ProjectInfoFlow flow : flows) {
                int ftype = flow.getFid();
                String fname=flow.getFname()==null?flow.getNickname():flow.getFname();
                String url = null;
                if (ftype == EnumTools.FlowNomalState.简历筛选.ordinal()) {
                    url = "SZResume/";
                } else if (ftype == EnumTools.FlowNomalState.素质.ordinal()) {
                    url = "SZQuality/";
                } else if (ftype == EnumTools.FlowNomalState.笔试.ordinal()) {
                    url = "SZExam/";
                } else if (ftype == EnumTools.FlowNomalState.资料审核.ordinal()) {
                    url = "SZCheck/";
                } else if (ftype == EnumTools.FlowNomalState.面试.ordinal()) {
                    url = "SZInterview/";
                } else if (ftype == EnumTools.FlowNomalState.实作.ordinal()) {
                    url = "SZOperation/";
                } else if (ftype == EnumTools.FlowNomalState.背景调查.ordinal()) {
                    url = "SZPReview/";
                } else if (ftype == EnumTools.FlowNomalState.体检.ordinal()) {
                    url = "SZPhysical/";

                } else if (ftype == EnumTools.FlowNomalState.实习.ordinal()) {
                    url = "SZPractice/";
                } else if (ftype == EnumTools.FlowState.录用.ordinal()) {
                    url = "SZEmploy/";
                } else {
                    url = "";
                }

                url += "?pid=" + pid + "&fid=" + flow.getId() + "&deptcode=" + flow.getDeptcode();
                result.append("<div class='cont cont" + flow.getState() + "'>");
                result.append("<a href='" + request.getContextPath() + "/Do/" + url + "'>");
                result.append("<span class='num'>" + index + "</span>");
                result.append("<span class='txt'>" + flow.getNickname() + "</span>");
                result.append("</a></div>");
                index++;
            }
            result.append("<div class='clear'></div>");
            utilService.printTextResult(result.toString(), response);
        } catch (Exception e) {
            utilService.printTextResult("", response);
        }
    }
    //[end]



    //[start] 获得招聘实施流程信息
    @RequestMapping(value = "/getFlowsJson",produces = "application/json;charset=utf-8")
    public @ResponseBody String getFlowsJson(HttpServletRequest request, HttpServletResponse response) {
        try {

            String pid = request.getParameter("pid").trim();
            String deptcode = request.getParameter("deptcode").trim();
            List<ProjectInfoFlow> flows = projectService.getThisFlowDept(pid, deptcode);
            StringBuilder result = new StringBuilder();
            int index = 1;
            result.append("[");
            for (ProjectInfoFlow flow : flows) {
                int ftype = flow.getFid();
                String fname=flow.getFname()==null?flow.getNickname():flow.getFname();
                String url = null;
               /* if (ftype == EnumTools.FlowState.简历筛选.ordinal()) {
                    url = "SZResume/";
                } else if (ftype == EnumTools.FlowState.笔试.ordinal()) {
                    url = "SZExam/";
                } else if (ftype == EnumTools.FlowState.资料审核.ordinal()) {
                    url = "SZCheck/";
                } else if (ftype == EnumTools.FlowState.面试.ordinal()) {
                    url = "SZInterview/";
                } else if (ftype == EnumTools.FlowState.实作.ordinal()) {
                    url = "SZOperation/";
                } else if (ftype == EnumTools.FlowState.背景调查.ordinal()) {
                    url = "SZPReview/";
                } else if (ftype == EnumTools.FlowState.体检.ordinal()) {
                    url = "SZPhysical/";
                } else if (ftype == EnumTools.FlowNomalState.实习.ordinal()) {
                    url = "SZPractice/";
                } else if (ftype == EnumTools.FlowNomalState.录用.ordinal()) {
                    url = "SZEmploy/";
                } else {
                    url = "";
                }*/
                if (fname.equalsIgnoreCase(EnumTools.FlowNomalState.简历筛选.name())) {
                    url = "SZResume/";
                } else if (fname.equalsIgnoreCase(EnumTools.FlowNomalState.素质.name())) {
                    url = "SZQuality/";
                } else if (fname.equalsIgnoreCase(EnumTools.FlowNomalState.笔试.name())) {
                    url = "SZExam/";
                } else if (fname.equalsIgnoreCase(EnumTools.FlowNomalState.资料审核.name()))  {
                    url = "SZCheck/";
                } else if (fname.equalsIgnoreCase(EnumTools.FlowNomalState.面试.name()))  {
                    url = "SZInterview/";
                } else if (fname.equalsIgnoreCase(EnumTools.FlowNomalState.实作.name())) {
                    url = "SZOperation/";
                } else if (fname.equalsIgnoreCase(EnumTools.FlowNomalState.背景调查.name())) {
                    url = "SZPReview/";
                } else if (fname.equalsIgnoreCase(EnumTools.FlowNomalState.体检.name())) {
                    url = "SZPhysical/";
                } else if (fname.equalsIgnoreCase(EnumTools.FlowNomalState.实习.name())){
                    url = "SZPractice/";
                } else if (fname.equalsIgnoreCase(EnumTools.FlowNomalState.录用.name())) {
                    url = "SZEmploy/";
                } else {
                    url = "";
                }

                /*url += "?pid=" + pid + "&fid=" + flow.getId() + "&deptcode=" + flow.getDeptcode();
                result.append("<div class='cont cont" + flow.getState() + "'>");
                result.append("<a href='" + request.getContextPath() + "/Do/" + url + "'>");
                result.append("<span class='num'>" + index + "</span>");
                result.append("<span class='txt'>" + flow.getNickname() + "</span>");
                result.append("</a></div>");*/
                String display="";
                String displayTab="";
                if (StringTools.trimNotEmpty(flow.getDisplay())){
                    if (flow.getDisplay().equalsIgnoreCase("是")){
                        display="显示";
                    }else{
                        display="不显示";
                        displayTab="(否)";
                    }
                }


                String href=request.getContextPath() + "/Do/" + url;
                result.append("{\"fid\":\""+flow.getId()+"\",\"state\":\""+flow.getState()+"\",\"num\":\""+index+"\",\"txt\":\""+flow.getNickname()+displayTab+"\",\"url\":\""+href+"\"},");
                index++;
            }
            result=result.replace(result.lastIndexOf(","),result.length(),"");
            result.append("]");



            //utilService.printTextResult(result.toString(), response);
            return result.toString();
        } catch (Exception e) {
            //utilService.printTextResult("", response);
            return "";
        }

    }
    //[end]


    //[start] 公布阶段审核结果（已公布->未公布/未公布->已公布）
    @SuppressWarnings({"rawtypes", "unchecked"})
    @RequestMapping(value = "/PublishResultAction", method = RequestMethod.POST)
    public void PublishResultAction(HttpServletRequest request, HttpServletResponse response) {
        try {
            String[] ids = request.getParameterValues("id");//人员信息ID
            if (ids != null) {
                String fid = request.getParameter("fid").trim();//招聘流程ID
                String deptcode = request.getParameter("deptcode").trim();//责任部门编码
                BaseUser usr = utilService.getSessionUser(request);
                if (usr.getUdept().equals(deptcode)) {
                    //流程是否结束
                    if (utilService.FlowIsDoing(fid)) {
                        List editlist = new ArrayList();
                        List<DUserResume> resumes = szService.getResumes(ids);
                        ProjectInfoFlow nFlow = szService.getCurrentFlow(fid);
                        if (nFlow.getFid() == EnumTools.GXFlowState.简历筛选.ordinal()) {
                            for (DUserResume user : resumes) {
                                if (user.getOp1() == null || user.getOp1().equals("未公布")) {
                                    user.setOp1("已公布");
                                }else {
                                    user.setOp1("未公布");
                                }
                                editlist.add(user);
                            }
                        }
                        if (nFlow.getFid() == EnumTools.GXFlowState.资料审核.ordinal()) {
                            for (DUserResume user : resumes) {
                                if (user.getOp2() == null || user.getOp2().equals("未公布")) {
                                    user.setOp2("已公布");
                                }else {
                                    user.setOp2("未公布");
                                }
                                editlist.add(user);
                            }
                        }
                        if (nFlow.getFid() == EnumTools.GXFlowState.背景调查.ordinal()) {
                            for (DUserResume user : resumes) {
                                if (user.getOp3() == null || user.getOp3().equals("未公布")) {
                                    user.setOp3("已公布");
                                }else {
                                    user.setOp3("未公布");
                                }
                                editlist.add(user);
                            }
                        }
                        if (nFlow.getFid() == EnumTools.GXFlowState.体检.ordinal()) {
                            for (DUserResume user : resumes) {
                                if (user.getOp4() == null || user.getOp4().equals("未公布")) {
                                    user.setOp4("已公布");
                                }else {
                                    user.setOp4("未公布");
                                }
                                editlist.add(user);
                            }
                        }
                        if (nFlow.getFid() == EnumTools.GXFlowState.录用.ordinal()) {
                            for (DUserResume user : resumes) {
                                if (user.getOp5() == null || user.getOp5().equals("未公布")) {
                                    user.setOp5("已公布");
                                }else {
                                    user.setOp5("未公布");
                                }
                                editlist.add(user);
                            }
                        }
                        if (nFlow.getFid() == EnumTools.GXFlowState.笔试.ordinal()) {
                            List<DoBSUser> bsUsers = bsService.getBsUsers(ids, fid);
                            for (DoBSUser user : bsUsers) {
                                if (user.getOp6() == null || user.getOp6().equals("未公布")) {
                                    user.setOp6("已公布");
                                }else {
                                    user.setOp6("未公布");
                                }
                                editlist.add(user);
                            }
                        }
                        if (nFlow.getFid() == EnumTools.GXFlowState.面试.ordinal()) {
                            List<DoMSUser> msUsers = msService.getMsUsers(ids, fid);
                            for (DoMSUser user : msUsers) {
                                if (user.getOp7() == null || user.getOp7().equals("未公布")) {
                                    user.setOp7("已公布");
                                }else {
                                    user.setOp7("未公布");
                                }
                                editlist.add(user);
                            }
                        }
                        if (nFlow.getFid() == EnumTools.GXFlowState.实作.ordinal()) {
                            List<DoOperationUser> szUsers = szService.getSZUsers(fid, ids);
                            for (DoOperationUser user : szUsers) {
                                if (user.getOp8() == null || user.getOp8().equals("未公布")) {
                                    user.setOp8("已公布");
                                }else {
                                    user.setOp8("未公布");
                                }
                                editlist.add(user);
                            }
                        }
                       /* if (nFlow.getFid() == EnumTools.GXFlowState.实习.ordinal()) {
                            for (DUserResume user : resumes) {
                                if (user.getOp7() == null || user.getOp7().equals("未公布")){
                                    user.setOp7("已公布");
                                } else {
                                    user.setOp7("未公布");
                                }
                                editlist.add(user);
                            }
                        }*/

                        if (editlist.size() > 0) {
                            utilService.editList(editlist);
                            utilService.printJsonResult(true, "操作成功！", "no", response);
                        } else {
                            utilService.printJsonResult(false, "当前选中的信息不能执行此操作！", "no", response);
                        }
                    } else {
                        utilService.printJsonResult(false, "当前流程不支持此操作！", "no", response);
                    }
                } else {
                    utilService.printJsonResult(false, "您无权执行此操作！", "no", response);
                }
            } else {
                utilService.printJsonResult(false, "请选择人员信息！", "no", response);
            }
        } catch (Exception e) {
            e.printStackTrace();
            utilService.printJsonResult(false, "操作失败！", "no", response);
        }
    }
    //[end]

    //[start] 推荐到其他岗位

    @RequestMapping("/RecommendPost")
    public String RecommendPost(HttpServletRequest request, Model model) {
        try {
            model.addAttribute("path", request.getContextPath());
            String pid = request.getParameter("pid").trim();
            String fid = request.getParameter("fid").trim();
            String deptcode = request.getParameter("deptcode").trim();

            model.addAttribute("pid", pid);
            model.addAttribute("fid", fid);
            model.addAttribute("deptcode", deptcode);

            //招聘岗位
            List<ProjectInfoJobs> jobs = projectService.getjobsbypid(pid);
            StringBuilder dstr = new StringBuilder();
            for (ProjectInfoJobs job : jobs) {
                dstr.append("<option value='" + job.getId() + "'>" + job.getJobname() + "</option>");
            }
            model.addAttribute("jobs", dstr);

            String[] ids = request.getParameterValues("id");
            List<DUserResume> resumes = szService.getResumes(ids);
            StringBuffer rs = new StringBuffer();
            StringBuffer _ids = new StringBuffer();
            for (DUserResume resume : resumes) {
                if (resume.getProid().equals(pid)
                        && resume.getFqstate().equals("未放弃")
                        && resume.getNrid() == null) {
                    rs.append("<tr><td>" + resume.getCode() + "</td><td>" + resume.getJname() + "</td><td>" + resume.getName() + "</td>");
                    rs.append("<td>" + resume.getSexname() + "</td><td>" + resume.getCardno() + "</td></tr>");

                    _ids.append("<input type='hidden' name='id' value='" + resume.getId() + "'/>");
                }
            }
            model.addAttribute("rs", rs);
            model.addAttribute("ids", _ids);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "Do/SZ/rpost";
    }

    @SuppressWarnings({"rawtypes", "unchecked"})
    @RequestMapping(value = "/RecommendPostAction", method = RequestMethod.POST)
    public void RecommendPostAction(HttpServletRequest request, HttpServletResponse response) {
        try {
            String[] ids = request.getParameterValues("id");//人员信息ID
            if (ids != null) {
                String fid = request.getParameter("fid").trim();//招聘流程ID
                String deptcode = request.getParameter("deptcode").trim();//责任部门编码
                BaseUser usr = utilService.getSessionUser(request);
                if (usr.getUdept().equals(deptcode)) {
                    //流程是否结束
                    if (utilService.FlowIsDoing(fid)) {
                        String gwcode = request.getParameter("gwcode").trim();
                        String gwname = request.getParameter("gwname").trim();

                        List addList = new ArrayList();
                        List editList = new ArrayList();

                        List<DUserResume> resumes = szService.getResumes(ids);
                        for (DUserResume resume : resumes) {
                            if (!gwcode.equals(resume.getJid())) {
                                String nid = UUID.randomUUID().toString();

                                ProjectInfoFlow flow = utilService.getFlow(resume.getFid());
                                if (flow.getFid() == EnumTools.FlowState.笔试.ordinal()) {
                                    DoBSUser bsu = null;
                                    try {
                                        bsu = bsService.getBsUser(resume.getId(), resume.getFid());
                                    } catch (Exception e) {
                                    }
                                    if (bsu != null) {
                                        DoBSUser nbsu = new DoBSUser();
                                        BeanTools.Copy(bsu, nbsu);
                                        nbsu.setId(UUID.randomUUID().toString());
                                        nbsu.setUserid(nid);
                                        addList.add(nbsu);
                                    }
                                }
                                if (flow.getFid() == EnumTools.FlowState.实作.ordinal()) {
                                    DoOperationUser osu = null;
                                    try {
                                        osu = szService.getSZUser(resume.getFid(), resume.getId());
                                    } catch (Exception e) {
                                    }
                                    if (osu != null) {
                                        DoOperationUser nosu = new DoOperationUser();
                                        BeanTools.Copy(osu, nosu);
                                        nosu.setId(UUID.randomUUID().toString());
                                        nosu.setUserid(nid);
                                        addList.add(nosu);
                                    }
                                }
                                if (flow.getFid() == EnumTools.FlowState.录用.ordinal()) {
                                    if (resume.getBdstate().equals("已报到")) {
                                        continue;
                                    }
                                }

                                String rid = resume.getId();
                                DUserResume nResume = new DUserResume();
                                BeanTools.Copy(resume, nResume);

                                nResume.setId(nid);
                                nResume.setRfid(resume.getFid());
                                nResume.setOrid(resume.getId());
                                nResume.setPath("/" + resume.getFid() + "/");
                                nResume.setJid(gwcode);
                                nResume.setJname(gwname);

                                addList.add(nResume);

                                //教育背景
                                List<DUserEducation> edus = doResumeService.getUserEducation(rid);
                                for (DUserEducation usereducation : edus) {
                                    DUserEducation dUserEducation = new DUserEducation();
                                    BeanTools.Copy(usereducation, dUserEducation);
                                    dUserEducation.setId(UUID.randomUUID().toString());
                                    dUserEducation.setRid(nid);
                                    addList.add(dUserEducation);
                                }
                                //工作经验
                                List<DUserWorkExperience> works = doResumeService.getUserWorkExperience(rid);
                                for (DUserWorkExperience userworkexperience : works) {
                                    DUserWorkExperience dUserWorkExperience = new DUserWorkExperience();
                                    BeanTools.Copy(userworkexperience, dUserWorkExperience);
                                    dUserWorkExperience.setId(UUID.randomUUID().toString());
                                    dUserWorkExperience.setRid(nid);
                                    addList.add(dUserWorkExperience);
                                }
                                //培训经历
                                List<DUserTraining> tras = doResumeService.getUserTraining(rid);
                                for (DUserTraining usertraining : tras) {
                                    DUserTraining dUserTraining = new DUserTraining();
                                    BeanTools.Copy(usertraining, dUserTraining);
                                    dUserTraining.setId(UUID.randomUUID().toString());
                                    dUserTraining.setRid(nid);
                                    addList.add(dUserTraining);
                                }
                                //获奖信息
                                List<DUserRewardPunishment> rewards = doResumeService.getUserRewardPunishment(rid);
                                for (DUserRewardPunishment userrewardpunishment : rewards) {
                                    DUserRewardPunishment dUserRewardPunishment = new DUserRewardPunishment();
                                    BeanTools.Copy(userrewardpunishment, dUserRewardPunishment);
                                    dUserRewardPunishment.setId(UUID.randomUUID().toString());
                                    dUserRewardPunishment.setRid(nid);
                                    addList.add(dUserRewardPunishment);
                                }
                                //家庭成员
                                List<DUserFamily> fams = doResumeService.getUserFamily(rid);
                                for (DUserFamily userfamily : fams) {
                                    DUserFamily dUserFamily = new DUserFamily();
                                    BeanTools.Copy(userfamily, dUserFamily);
                                    dUserFamily.setId(UUID.randomUUID().toString());
                                    dUserFamily.setRid(nid);
                                    addList.add(dUserFamily);
                                }

                                resume.setNrid(nid);
                                resume.setRfid(resume.getFid());
                                resume.setNjname(gwname);
                                editList.add(resume);
                            }
                        }
                        if (editList.size() > 0 && addList.size() > 0) {
                            utilService.editList(editList, addList);
                            utilService.printJsonResult(true, "推荐成功！", "no", response);
                        } else {
                            utilService.printJsonResult(false, "当前选中的简历不能推荐到该岗位！", "no", response);
                        }
                    } else {
                        utilService.printJsonResult(false, "当前流程不支持此操作！", "no", response);
                    }
                } else {
                    utilService.printJsonResult(false, "您无权执行此操作！", "no", response);
                }
            } else {
                utilService.printJsonResult(false, "请选择需要推荐的人员！", "no", response);
            }
        } catch (Exception e) {
            e.printStackTrace();
            utilService.printJsonResult(false, "操作失败！", "no", response);
        }
    }

    //[end]
    @ResponseBody
    @RequestMapping(value = "/RecruitmentHistory")
    public ResultBean RecruitmentHistory(HttpServletRequest request, HttpServletResponse response){
        String cardNo=request.getParameter("cardno");
        ResultBean resultBean=new ResultBean();
        try {
            List<Map<String,Object>> userResumeList= doResumeService.getDResumeByCardNo(cardNo);

            if(userResumeList!=null&&userResumeList.size()>0){
                List<Map> resultList=new ArrayList<>();
                for (Map<String,Object> dUserResume : userResumeList) {
                    Map resultMap=new HashMap<String,String>();
                    resultMap.put("cardno",dUserResume.get("CARDNO"));
                    resultMap.put("name",dUserResume.get("NAME"));
                    resultMap.put("sexname",dUserResume.get("SEXNAME"));
                    resultMap.put("proid",dUserResume.get("PROID"));
                    resultMap.put("proname",dUserResume.get("PRONAME"));
                    resultMap.put("adddate", dUserResume.get("JTIME"));
                    resultMap.put("jname", dUserResume.get("JNAME"));
                    resultMap.put("fid",dUserResume.get("FID"));
                    resultMap.put("lastflow",dUserResume.get("LASTFLOW"));

                    resultList.add(resultMap);

                }
                resultBean.setTotalResult(String.valueOf(userResumeList.size()));
                resultBean.setState(true);
                resultBean.setMessage("操作成功!");
                resultBean.setDatas(resultList);
            }else{
                resultBean.setState(false);
                resultBean.setMessage("该人员尚未参加应聘!");
                resultBean.setDatas(userResumeList);
            }

        } catch (Exception e) {
            e.printStackTrace();
            return  resultBean;
        }
        return resultBean;
    }

    @ResponseBody
    @RequestMapping(value = "/RecruitmentFlowsInfo")
    public ResultBean RecruitmentFlowsInfo(HttpServletRequest request,HttpServletResponse response){
        String cardNo=  request.getParameter("cardno");
        String pid=request.getParameter("proid");
        String userId=request.getParameter("uid");
        ResultBean resultBean=new ResultBean();
        if (StringTools.notEmpty(userId)){
            try {
                List<Map<String,Object>>  resultList;
                if((pid.toUpperCase().indexOf("C_")>=0)&&((pid.toUpperCase().indexOf("E_")>=0))){
                    resultList= doResumeService.getZZUserDResumeFlowsInfo(userId);
                }else{
                    resultList= doResumeService.getDResumeFlowsInfo(userId);
                }

                resultBean.setState(true);
                resultBean.setMessage("操作成功!");
                resultBean.setDatas(resultList);
            }catch (Exception e){
                e.printStackTrace();
                return  resultBean;
            }
        }
        return resultBean;
    }

}
